﻿using System;
using UnityEngine;
using UnityEngine.EventSystems;
using Utility;

// Token: 0x02000390 RID: 912
public class ShortCut_Help : MonoBehaviour
{
	// Token: 0x06001677 RID: 5751 RVA: 0x0009615C File Offset: 0x0009435C
	private void Start()
	{
		if (this.shortCut != null)
		{
			this.shortCut.alpha = 0f;
		}
		if (this.help != null)
		{
			this.help.alpha = 0f;
		}
	}

	// Token: 0x06001678 RID: 5752 RVA: 0x000961AC File Offset: 0x000943AC
	private void Update()
	{
		this.UpdateInput();
		if (this.shortCut != null)
		{
			float goal = (this.state != ShortCut_Help.STATE.SHORTCUT) ? 0f : 1f;
			this.shortCut.alpha = Tween.Spring(this.shortCut.alpha, goal, this.K, Time.deltaTime, 0.01f, 0f);
		}
		if (this.help != null)
		{
			float goal = (this.state != ShortCut_Help.STATE.HELP) ? 0f : 1f;
			this.help.alpha = Tween.Spring(this.help.alpha, goal, this.K, Time.deltaTime, 0.01f, 0f);
		}
	}

	// Token: 0x06001679 RID: 5753 RVA: 0x00096284 File Offset: 0x00094484
	private void UpdateInput()
	{
		if (EventSystem.current != null && EventSystem.current.currentSelectedGameObject != null)
		{
			return;
		}
		if (Input.GetKeyDown(KeyCode.F2) && this.shortCut != null)
		{
			if (this.state != ShortCut_Help.STATE.SHORTCUT)
			{
				SystemSE.Play(SystemSE.SE.OPEN);
				this.state = ShortCut_Help.STATE.SHORTCUT;
			}
			else
			{
				SystemSE.Play(SystemSE.SE.CLOSE);
				this.state = ShortCut_Help.STATE.NONE;
			}
		}
		if (Input.GetKeyDown(KeyCode.F3) && this.help != null)
		{
			if (this.state != ShortCut_Help.STATE.HELP)
			{
				SystemSE.Play(SystemSE.SE.OPEN);
				this.state = ShortCut_Help.STATE.HELP;
			}
			else
			{
				SystemSE.Play(SystemSE.SE.CLOSE);
				this.state = ShortCut_Help.STATE.NONE;
			}
		}
	}

	// Token: 0x04001A3E RID: 6718
	[SerializeField]
	private CanvasGroup shortCut;

	// Token: 0x04001A3F RID: 6719
	[SerializeField]
	private CanvasGroup help;

	// Token: 0x04001A40 RID: 6720
	[SerializeField]
	private float K = 10f;

	// Token: 0x04001A41 RID: 6721
	private ShortCut_Help.STATE state;

	// Token: 0x04001A42 RID: 6722
	private float rate = 1f;

	// Token: 0x02000391 RID: 913
	private enum STATE
	{
		// Token: 0x04001A44 RID: 6724
		NONE,
		// Token: 0x04001A45 RID: 6725
		SHORTCUT,
		// Token: 0x04001A46 RID: 6726
		HELP
	}
}
